package homework.yuandan.common.vo;

import homework.yuandan.common.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 作者:49293
 * 时间:2020/12/30-19:42
 * @author 49293
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO<T> {
    private Integer code;
    private String msg;
    private T data;

    public ResultVO(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public ResultVO(ResponseEnum responseEnum, T data){
        this.code=responseEnum.getCode();
        this.msg=responseEnum.getMsg();
        this.data=data;
    }
    public ResultVO(ResponseEnum responseEnum){
        this.code=responseEnum.getCode();
        this.msg=responseEnum.getMsg();
    }
}
